<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use phpDocumentor\Reflection\Types\This;

class Bestsellers extends Model
{
    protected $table ='bestsellers';
    
    protected $casts = [
        'extra' => 'json',
    ];
    
    public function bestsellercategories(){
        return $this->hasOne(BestsellersCategories::class, 'id', 'category');
    }

    public function product()
    {
        return $this->belongsTo(Product::class, 'pid', 'id');
    }
}
